package com.ibm.cps.spark.streaming

import scala.sys.process._
import org.apache.log4j._
/**
 * Created by telekinesis on 6/14/15.
 */
object SparkTopologyStarter {
  private[this] val logger = Logger.getLogger(SparkTopologyStarter.getClass)

  def main(args: Array[String]) {
    val masterURL = args(0)
    val appName = args(1)
    start("./runCpsSpark.sh", masterURL, appName)
  }

  def start(shellPath : String, masterURL : String, appName : String): Unit ={
    val cmd = shellPath + " " + masterURL + " " + appName
    val output = cmd.!!
    logger.info(output)
  }

}
